//
//  VoiceViewController.m
//  Version1.0_RectiveCocoa
//
//  Created by 吴可高 on 2018/1/21.
//  Copyright © 2018年 吴可高. All rights reserved.
//

#import "VoiceViewController.h"
#import "Voice_Bottom_View.h"
#import "Voice_ContentView.h"
@interface VoiceViewController ()
@property(nonatomic,strong) Voice_Bottom_View * bottom_view;
@property(nonatomic,strong) Voice_ContentView * content_View;

@end

@implementation VoiceViewController
#pragma mark - getter methods
-(Voice_ContentView *)content_View{
    _content_View = ({
        if (!_content_View) {
            _content_View = [[Voice_ContentView alloc]initWithFrame:CGRectZero];
        }
        _content_View;
    });
    return _content_View;
}
-(Voice_Bottom_View *)bottom_view{
    _bottom_view = ({
        if (!_bottom_view) {
             _bottom_view = [[Voice_Bottom_View alloc]init];
             _bottom_view.handler = ^(UIButton * args){
                
            };
        }
        _bottom_view;
    });
    return _bottom_view;
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:NO];
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

-(void)initializeNavigationBar{
    self.view.backgroundColor = UIColorFromRGB(0x151724);
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self initializeNavigationBar];
    [self configurationOptionalViews];
    [self layoutSubViews];
}

-(void)configurationOptionalViews{
    [self.view addSubview:self.content_View];
    [self.view addSubview:self.bottom_view];
}

-(void)layoutSubViews{
    __weak  typeof(self)weakSelf = self;
    [self.bottom_view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.mas_equalTo(weakSelf.view);
        make.bottom.mas_equalTo(weakSelf.view.mas_bottom).with.offset(-44-40);
        make.height.mas_equalTo(@130);
    }];
    [self.content_View mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.mas_equalTo(weakSelf.view);
        make.top.mas_equalTo(weakSelf.view.mas_top).offset(64.f);
        make.bottom.mas_equalTo(weakSelf.bottom_view.mas_top);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
